<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/5/24
  Time: 16:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员登录</title>


    <style>
        #formDiv{
            border: 1px solid #000;
            width:420px ;
            height: 230px;
            margin: 150px 0 0 400px;
            border-radius: 3px;
        }

        #userDiv{
            margin: 40px 0 0 80px;
        }

        #pwdDiv{
            margin: 20px 0 0 80px;
        }
        #btnDiv{
            margin: 20px 0 0 150px;
        }
        body{
            background-image:url("${pageContext.request.contextPath}/img/bg.jpg");
        }
    </style>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet"/>
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</head>
<body>

    <%--jsp动态获取web上下文路径
        el表达式 ${}可以操作javaBean
        pageContext--获取请求对象 getRequest() :get()去掉, request就是bean属性
        ServletRequest--->getContextPath()--get()去掉,contextPath就是servletrequest的bean属性
    --%>
   <%-- ${pageContext.request.contextPath}--%>
<%--<div id="formDiv">--%>
    <%--<form action="${pageContext.request.contextPath}/login" method="post">
        <div id="userDiv">
            <!--lable和input 表单组件-->
            <label>用户名</label>
            <input type="text" name="username" placeholder="请输入用户名"/>
        </div>

        <div id="pwdDiv">
            <!--lable和input 表单组件-->
            <label>密&ensp;&ensp;码</label>
            <input type="password" name="password" placeholder="请输入用户名"/>
        </div>
        <div id="btnDiv">
            <input type="submit" value="登录"/>
        </div>
    </form>--%>

    <div class="container-fluid">

        <form class="form-horizontal" action="${pageContext.request.contextPath}/admin?methodName=adminLogin" method="post"  id="formDiv">
            <div class="form-group" id="userDiv">
                <label for="username" class="col-md-4 control-label">管理员名称</label>
                <div class="col-md-8">
                    <input type="text" class="form-control" name="username" id="username" placeholder="请输入用户名">
                </div>
            </div>
            <div class="form-group" id="pwdDiv">
                <label for="inputPassword3" class="col-md-4 control-label">管理员密码</label>
                <div class="col-md-8">
                    <input type="password" name="password" class="form-control"
                           id="inputPassword3" placeholder="请输入密码">
                </div>
            </div>
           <%-- <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox"> Remember me
                        </label>
                    </div>
                </div>
            </div>--%>
            <div class="form-group" id="btnDiv">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary">登录</button>
                </div>
            </div>
        </form>
    <span style="text-align: center;font-size: 15px;color: red;">${msg}</span>
</div>
</body>
</html>
